home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
001
/
hayestst.arc
/
HAYESTST.BAS
Wrap
BASIC Source File
|
1985-11-25
|
3KB
|
99 lines
10 CLS
20 PRINT "Hayes SMARTMODEM Switch Test"
30 PRINT "(C) Copyright 1984, Sally A. Gaer"
50 PRINT
55 GOSUB 960
60 PRINT "MODEM test started. Test will take about 15 seconds ..";
70 ON ERROR GOTO 890
80 DIM A$(20)
90 S1$="?": S2$="?": S3$="?": S4$="?": S5$="?": S6$="?"
100 S7$="?": S8$="?"
110 OPEN "com1:300,e,7,2" AS #1
120 S6$="D"
130 '
140 '
150 '------------Reset Modem------------
160 '
170 PRINT "..";
180 FOR I=1 TO 2000
190 NEXT I
200 PRINT#1,"+++";
210 FOR I=1 TO 2000
220 NEXT I
230 PRINT#1,"ATZ"
240 FOR I=1 TO 2000
250 NEXT I
260 PRINT "..";
270 '
280 '
290 '-------Reset modem again and check for return code and echo-----
300 '
310 GOSUB 830
320 A=INSTR(1,A$,"OK"): IF A>0 THEN S3$="D": S2$="U": GOTO 360
330 A=1
340 A=INSTR(A,A$,"0"): IF A>0 THEN S3$="D": S2$="D": GOTO 360
350 S3$="U"
360 PRINT#1,"ATZ"
370 FOR I=1 TO 2000: NEXT I
380 PRINT "..";
390 GOSUB 830
400 '
410 '-------Check for echo---------
420 '
430 IF LEFT$(A$,3)="ATZ" THEN S4$="U": GOTO 440 ELSE S4$="D"
440 IF LEFT$(A$,1)="0" THEN S2$="D": GOSUB 670: STOP
450 GOSUB 500: GOTO 600
460 '
470 '
480 '-------Chexk Modem Status Registers for switch settings ------
490 '
500 PRINT#1,"AT S13? S14? S15?"
510 FOR I=1 TO 4000: NEXT I
520 GOSUB 830
530 IF S4$="U" THEN A$=MID$(A$,19,255)
540 S13=VAL(LEFT$(A$,3)): S14=VAL(MID$(A$,5,3)): S15=VAL(MID$(A$,9,3))
550 IF S13=0 AND S14=0 AND S15=0 THEN S8$="U" ELSE S8$="D"
560 RETURN
570 '
580 '
590 '
600 S5$=MID$(A$,7,1): IF S5$="1" OR S5$="3" OR S5$="5" OR S5$="7" THEN S5$="U" ELSE S5$="D"
610 IF S8$="U" THEN S5$="?": S2$="?": S3$="?"
620 GOSUB 670
630 C$=S1$+S2$+S3$+S4$+S5$+S6$+S7$+S8$
640 IF C$="?UDUDD?D" THEN PRINT "MODEM switch settings are correct": BEEP: END
650 PRINT "MODEM switch settings are incorrect"
660 STOP
670 PRINT "Modem switch settings"
680 PRINT "Switch 1 = ";S1$
690 PRINT "Switch 2 = ";
700 IF S2$="U" THEN PRINT S2$: GOTO 710 ELSE COLOR 31: PRINT S2$: COLOR 15
710 PRINT "Switch 3 = ";
720 IF S3$="D" THEN PRINT S3$: GOTO 730 ELSE COLOR 31: PRINT S3$: COLOR 15
730 PRINT "Switch 4 = ";
740 IF S4$="U" THEN PRINT S4$: GOTO 750 ELSE COLOR 31: PRINT S4$: COLOR 15
750 PRINT "Switch 5 = ";
760 IF S5$="D" THEN PRINT S5$: GOTO 770 ELSE COLOR 31: PRINT S5$: COLOR 15
770 PRINT "Switch 6 = ";
780 IF S6$="D" THEN PRINT S6$: GOTO 790 ELSE COLOR 31: PRINT S6$: COLOR 15
790 PRINT "Switch 7 = ";
800 IF S7$="?" THEN PRINT S7$: GOTO 810 ELSE COLOR 31: PRINT S7$: COLOR 15
810 PRINT "Switch 8 = ";S8$
820 RETURN
830 A$=""
840 WHILE NOT EOF(1)
850 PRINT ".";
860 A$=A$+INPUT$(LOC(1),#1)
870 WEND
880 RETURN
890 IF ERR=24 THEN S6$="U": GOSUB 670: STOP
900 PRINT "Unknown error "
910 RESUME
960 PRINT : PRINT "Turn your modem power switch off and then on"
970 PRINT "Press enter when you have done this"
980 A$=""
990 A$=INKEY$: IF A$="" THEN GOTO 990
1000 RETURN
1010 RETURN
970 PRINT "Press enter when